import axios from '@/utils/http'


//客服管理========================================================

// 查询所有客服消息-------------------
export const cusInfoApi = '/customer/customerService/findServiceList'
//删除一条客服消息  
export const delCusInfoApi = '/customer/customerService/deleteService'
//新增
export const addInfoApi = '/customer/customerService/addService'
//条件查询
export const searchApi = '/customer/customerService/getServiceByTitle'
//查询所有患者
export const findPatientApi = '/Patient/management/findPatientList'
//在弹框中按名字搜索
export const findPatientNameApi = '/Patient/management/findPatientByName'
//修改
export const changeCusInfoApi = '/customer/customerService/updateService'

//封装请求方法
// 查询所有客服消息
function cusInfo(params) {
    return axios.get(cusInfoApi, { params })
}
//删除一条客服消息  
function delCusInfo(id) {
    return axios.post(delCusInfoApi + "?id=" + id)
}
//新增
function addCusInfo(params) {
    // return axios.post(addInfoApi+"?customer="+customer)
    return axios.post(addInfoApi, params)
}
//条件查询
function searchInfo(params) {
    return axios.get(searchApi, { params })
}
//查询所有患者
function findPatient(params) {
    return axios.get(findPatientApi, { params })
}
//在弹框中按名字搜索
function findPatientName(currentPage, name, pageSize) {
    return axios.post(findPatientNameApi + "?name=" + name + "&currentPage=" + currentPage + "&pageSize=" + pageSize)
}
//修改
function changeCusInfo(params) {
    return axios.post(changeCusInfoApi, params)
}
//=======================================================





//问题管理=======================================================

//查询所有问题信息
export const quesApi = '/customer/questionManagement/findQuestionList'
//删除问题信息
export const delQueApi = '/customer/questionManagement/deleteQuestion'
//查找问题信息
export const findQueApi = '/customer/questionManagement/getQuestionByTitle'
//新增
export const addQueApi = '/customer/questionManagement/addQuestion'
//修改
export const changeQueApi = '/customer/questionManagement/updateQuestion'




//问题管理========================================================
//获取列表
function getQuesApi(params) {
    return axios.get(quesApi, { params })
}
//删除问题信息
function delQue(id) {
    return axios.post(delQueApi + "?id=" + id)
}
//查找问题信息
function findQue(params) {
    return axios.get(findQueApi, { params })
}
//新增addQueApi
function addQueInfo(params) {
    return axios.post(addQueApi, params)
}
//修改changeQueApi
function changeQue(params) {
    return axios.post(changeQueApi, params)
}

//客服报表=========================================================
//4种客服
export const fourNumApi = '/customer/report/findReportList'
//客服统计
export const cusStaApi = '/customer/report/findReportDate'
//占比
export const percentApi='/customer/report/findReportType'
//年度报表
export const YearReportApi='/customer/report/findYearReport'




//客服报表方法=========================================================
//4种客服
function fourNum() {
    return axios.get(fourNumApi)
}
//客服统计
function cusSta() {
    return axios.get(cusStaApi)
}
//占比
function percent() {
    return axios.get(percentApi)
}
//年度报表
function YearReport() {
    return axios.get(YearReportApi)
}





export {
    cusInfo,//客服管理
    delCusInfo,//删
    changeCusInfo,//改
    addCusInfo,//增
    findPatientName,//
    findPatient,//
    searchInfo,//
    //============================
    getQuesApi,//问题管理
    delQue,//删
    findQue,//主查
    addQueInfo,//增加
    changeQue,//修改
    //============================
    fourNum,
    cusSta,
    percent,
    YearReport
}